﻿using BW.WMS.Application.Features.Location.Dtos;
using BW.WMS.Core.Result;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BW.WMS.Application.Features.Location.Interfaces
{
    /// <summary>
    /// WMS仓库管理—库位服务接口层
    /// </summary>
    public interface IWMS_LocationService
    {
        /// <summary>
        /// 获取库位分页列表，支持多条件查询
        /// </summary>
        /// <param name="queryDto">查询条件DTO</param>
        /// <returns>库位分页数据</returns>
        Task<ApiPage<WMS_LocationDto>> GetLocationPageListAsync(WMS_LocationQueryDto queryDto);

        /// <summary>
        /// 根据ID获取库位详情，包括库位基本信息和下属货位列表
        /// </summary>
        /// <param name="id">库位ID</param>
        /// <returns>库位详情DTO，包含基本信息和货位集合</returns>
        Task<ApiResult<WMS_LocationDto>> GetLocationByIdAsync(long id);

        /// <summary>
        /// 创建新库位
        /// </summary>
        /// <param name="createDto">库位创建DTO</param>
        /// <returns>操作结果，成功时返回新创建的库位ID</returns>
        Task<ApiResult<long>> CreateLocationAsync(WMS_LocationCreateDto createDto);

        /// <summary>
        /// 更新库位信息
        /// </summary>
        /// <param name="updateDto">库位更新DTO</param>
        /// <returns>操作结果，表示更新是否成功</returns>
        Task<ApiResult<bool>> UpdateLocationAsync(WMS_LocationUpdateDto updateDto);

        /// <summary>
        /// 删除库位（逻辑删除）
        /// </summary>
        /// <param name="id">库位ID</param>
        /// <returns>操作结果，表示删除是否成功</returns>
        Task<ApiResult<bool>> DeleteLocationAsync(long id);

        /// <summary>
        /// 批量删除库位（逻辑删除）
        /// </summary>
        /// <param name="ids">库位ID列表</param>
        /// <param name="updatedBy">操作人</param>
        /// <returns>操作结果，表示删除是否成功</returns>
        Task<ApiResult<bool>> BatchDeleteLocationsAsync(List<long> ids);

        /// <summary>
        /// 更新库位状态
        /// </summary>
        /// <param name="id">库位ID</param>
        /// <param name="status">新状态值</param>
        /// <param name="updatedBy">操作人</param>
        /// <returns>操作结果，表示状态更新是否成功</returns>
        Task<ApiResult<bool>> UpdateLocationStatusAsync(long id, int status, string updatedBy);
    }
}
